﻿using System;
using ParserGenerator.ScannerConstruction;

namespace ParserGenerator.GrammarAnalysis
{
    [Serializable]
    internal sealed class LexicalPrecedenceConflict
    {
        public ScannerAutomatonState State { get; }
        public LexicalPrecedenceProfile Profile { get; }

        public LexicalPrecedenceConflict(ScannerAutomatonState state, LexicalPrecedenceProfile profile)
        {
            if (state == null)
                throw new ArgumentNullException(nameof(state));
            if (profile == null)
                throw new ArgumentNullException(nameof(profile));
            State = state;
            Profile = profile;
        }

        public sealed override string ToString()
        {
            return string.Format("{0}: {1}", State, Profile);
        }
    }
}
